/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * IFMunicipios.java
 *
 * Created on 06/02/2012, 08:58:27
 */
package gui.frames.internos;

import controle.gui.frames.internos.ControleLocalidades;
import controle.gui.superclasses.InternalFrame;
import gui.componentes.JTextFieldCodigo;

/**
 * Frame interno para gerenciamento de Localidades e Croquis
 * 
 * @author Maycon Fernando Silva Brito
 * @author mayconfsbrito@gmail.com
 */
public class IFLocalidades extends InternalFrame {

    /*Variáveis da classe*/
    private ControleLocalidades controle = new ControleLocalidades(this);
    public SelectionListener listener;
    
    /*Creates new form IFMunicipios*/
    public IFLocalidades() {
        initComponents();
        this.listener = new SelectionListener(this.tabela);
        this.inicializa();
    }
    
    @Override
    protected void inicializa() {
        controle.inicializa();
    }
    
    @Override
    protected void limparGUI() {
        controle.limparGUI();
    }

    @Override
    protected void tabelaPreencheGUI(){
        controle.tabelaPreencheGUI();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panelInformacoes = new javax.swing.JPanel();
        labelId = new javax.swing.JLabel();
        labelNome = new javax.swing.JLabel();
        labelMunicípio = new javax.swing.JLabel();
        textNome = new javax.swing.JTextField();
        textId = new javax.swing.JTextField();
        labelCodigo = new javax.swing.JLabel();
        textCodigo = new JTextFieldCodigo(4, false);
        textNomeMunicipio = new javax.swing.JTextField();
        textCodigoMunicipio = new JTextFieldCodigo(7, true);
        panelLocalidades = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabela = new javax.swing.JTable();
        panelBusca = new javax.swing.JPanel();
        labelBuscaNome = new javax.swing.JLabel();
        labelBuscaMunicipio = new javax.swing.JLabel();
        textBuscaNome = new javax.swing.JTextField();
        buttonBuscar = new javax.swing.JButton();
        buttonLimparBusca = new javax.swing.JButton();
        textBuscaCodigo = new JTextFieldCodigo(4, false);
        labelBuscaCodigo = new javax.swing.JLabel();
        textBuscaNomeMunicipio = new javax.swing.JTextField();
        textBuscaCodigoMunicipio = new JTextFieldCodigo(7, true);
        panelOpcoes = new javax.swing.JPanel();
        buttonCancelar = new javax.swing.JButton();
        buttonCadastro = new javax.swing.JButton();
        buttonAlterar = new javax.swing.JButton();
        buttonLimpar = new javax.swing.JButton();
        panelCroqui = new javax.swing.JPanel();
        buttonCroquiVisualizar = new javax.swing.JButton();
        buttonCroquiAnexar = new javax.swing.JButton();
        buttonCroquiAlterar = new javax.swing.JButton();
        buttonCroquiRemover = new javax.swing.JButton();
        labelUltimaVersao = new javax.swing.JLabel();
        textDataCroqui = new javax.swing.JTextField();
        textHoraCroqui = new javax.swing.JTextField();
        labelAs = new javax.swing.JLabel();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Localidades");

        panelInformacoes.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Informações da Localidade", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        labelId.setText("Id:");

        labelNome.setText("Nome:");

        labelMunicípio.setText("Município:>");

        textId.setEnabled(false);

        labelCodigo.setText("Código:");

        textCodigo.setEnabled(false);

        textNomeMunicipio.setEnabled(false);
        textNomeMunicipio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textNomeMunicipioActionPerformed(evt);
            }
        });

        textCodigoMunicipio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textCodigoMunicipioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelInformacoesLayout = new javax.swing.GroupLayout(panelInformacoes);
        panelInformacoes.setLayout(panelInformacoesLayout);
        panelInformacoesLayout.setHorizontalGroup(
            panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelInformacoesLayout.createSequentialGroup()
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(labelNome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(labelCodigo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(labelId, javax.swing.GroupLayout.Alignment.LEADING))
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelInformacoesLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelInformacoesLayout.createSequentialGroup()
                                .addComponent(textCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(panelInformacoesLayout.createSequentialGroup()
                                .addComponent(textId, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(labelMunicípio)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(textCodigoMunicipio, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(textNomeMunicipio))))
                    .addGroup(panelInformacoesLayout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addComponent(textNome)))
                .addContainerGap())
        );
        panelInformacoesLayout.setVerticalGroup(
            panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelInformacoesLayout.createSequentialGroup()
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelId)
                    .addComponent(textId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textCodigoMunicipio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelMunicípio)
                    .addComponent(textNomeMunicipio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelNome)
                    .addComponent(textNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelCodigo)
                    .addComponent(textCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0))
        );

        panelLocalidades.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Localidades Cadastradas", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        tabela.setAutoCreateRowSorter(true);
        tabela.setFont(new java.awt.Font("DejaVu Sans", 0, 11)); // NOI18N
        tabela.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Código", "Nome", "Id Município", "Município", "Croqui"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Object.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabela.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane1.setViewportView(tabela);

        panelBusca.setBorder(javax.swing.BorderFactory.createTitledBorder("Busca"));

        labelBuscaNome.setText("Nome:");

        labelBuscaMunicipio.setText("Município:>");

        buttonBuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Buscar.png"))); // NOI18N
        buttonBuscar.setText("Buscar");
        buttonBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonBuscarActionPerformed(evt);
            }
        });

        buttonLimparBusca.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Limpar.png"))); // NOI18N
        buttonLimparBusca.setText("Limpar Busca");
        buttonLimparBusca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLimparBuscaActionPerformed(evt);
            }
        });

        labelBuscaCodigo.setText("Código:");

        textBuscaNomeMunicipio.setEnabled(false);
        textBuscaNomeMunicipio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textBuscaNomeMunicipioActionPerformed(evt);
            }
        });

        textBuscaCodigoMunicipio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textBuscaCodigoMunicipioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelBuscaLayout = new javax.swing.GroupLayout(panelBusca);
        panelBusca.setLayout(panelBuscaLayout);
        panelBuscaLayout.setHorizontalGroup(
            panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBuscaLayout.createSequentialGroup()
                .addComponent(buttonBuscar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonLimparBusca)
                .addContainerGap())
            .addGroup(panelBuscaLayout.createSequentialGroup()
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelBuscaMunicipio)
                    .addComponent(labelBuscaCodigo))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(textBuscaCodigo, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
                    .addComponent(textBuscaCodigoMunicipio, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textBuscaNomeMunicipio)
                    .addGroup(panelBuscaLayout.createSequentialGroup()
                        .addComponent(labelBuscaNome)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(textBuscaNome))))
        );
        panelBuscaLayout.setVerticalGroup(
            panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBuscaLayout.createSequentialGroup()
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelBuscaNome)
                    .addComponent(textBuscaNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelBuscaCodigo)
                    .addComponent(textBuscaCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelBuscaMunicipio)
                    .addComponent(textBuscaNomeMunicipio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textBuscaCodigoMunicipio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(panelBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buttonBuscar)
                    .addComponent(buttonLimparBusca)))
        );

        javax.swing.GroupLayout panelLocalidadesLayout = new javax.swing.GroupLayout(panelLocalidades);
        panelLocalidades.setLayout(panelLocalidadesLayout);
        panelLocalidadesLayout.setHorizontalGroup(
            panelLocalidadesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelBusca, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jScrollPane1)
        );
        panelLocalidadesLayout.setVerticalGroup(
            panelLocalidadesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelLocalidadesLayout.createSequentialGroup()
                .addComponent(panelBusca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE)
                .addGap(0, 0, 0))
        );

        panelOpcoes.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Opções", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        buttonCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Cancelar.png"))); // NOI18N
        buttonCancelar.setText("Cancelar");
        buttonCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCancelarActionPerformed(evt);
            }
        });

        buttonCadastro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Confirma.png"))); // NOI18N
        buttonCadastro.setText("Cadastrar");
        buttonCadastro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCadastroActionPerformed(evt);
            }
        });

        buttonAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Alterar.png"))); // NOI18N
        buttonAlterar.setText("Alterar");
        buttonAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonAlterarActionPerformed(evt);
            }
        });

        buttonLimpar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Novo.png"))); // NOI18N
        buttonLimpar.setText("Novo/Limpar");
        buttonLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLimparActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelOpcoesLayout = new javax.swing.GroupLayout(panelOpcoes);
        panelOpcoes.setLayout(panelOpcoesLayout);
        panelOpcoesLayout.setHorizontalGroup(
            panelOpcoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelOpcoesLayout.createSequentialGroup()
                .addComponent(buttonCadastro)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonAlterar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonLimpar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonCancelar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panelOpcoesLayout.setVerticalGroup(
            panelOpcoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(buttonCadastro)
            .addGroup(panelOpcoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(buttonAlterar)
                .addComponent(buttonLimpar)
                .addComponent(buttonCancelar))
        );

        panelCroqui.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Croqui", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        buttonCroquiVisualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Croqui_Visualizar.png"))); // NOI18N
        buttonCroquiVisualizar.setText("Visualizar");
        buttonCroquiVisualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCroquiVisualizarActionPerformed(evt);
            }
        });

        buttonCroquiAnexar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Croqui_Anexar.png"))); // NOI18N
        buttonCroquiAnexar.setText("Anexar");
        buttonCroquiAnexar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCroquiAnexarActionPerformed(evt);
            }
        });

        buttonCroquiAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Croqui_Alterar.png"))); // NOI18N
        buttonCroquiAlterar.setText("Alterar");
        buttonCroquiAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCroquiAlterarActionPerformed(evt);
            }
        });

        buttonCroquiRemover.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Croqui_Remover.png"))); // NOI18N
        buttonCroquiRemover.setText("Remover");
        buttonCroquiRemover.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCroquiRemoverActionPerformed(evt);
            }
        });

        labelUltimaVersao.setText("Ultima versão:");

        textDataCroqui.setEnabled(false);

        textHoraCroqui.setEnabled(false);

        labelAs.setText("às");

        javax.swing.GroupLayout panelCroquiLayout = new javax.swing.GroupLayout(panelCroqui);
        panelCroqui.setLayout(panelCroquiLayout);
        panelCroquiLayout.setHorizontalGroup(
            panelCroquiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelCroquiLayout.createSequentialGroup()
                .addComponent(buttonCroquiVisualizar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonCroquiAnexar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonCroquiAlterar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonCroquiRemover)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(labelUltimaVersao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textDataCroqui, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(labelAs)
                .addGap(8, 8, 8)
                .addComponent(textHoraCroqui, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        panelCroquiLayout.setVerticalGroup(
            panelCroquiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelCroquiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(buttonCroquiVisualizar)
                .addComponent(buttonCroquiAnexar)
                .addComponent(buttonCroquiAlterar)
                .addComponent(buttonCroquiRemover))
            .addGroup(panelCroquiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(labelUltimaVersao)
                .addComponent(textDataCroqui, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(textHoraCroqui, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(labelAs))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelLocalidades, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelInformacoes, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelOpcoes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelCroqui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(panelLocalidades, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(0, 0, 0)
                .addComponent(panelInformacoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(panelCroqui, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(panelOpcoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonCadastroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCadastroActionPerformed
        controle.cadastrar();
    }//GEN-LAST:event_buttonCadastroActionPerformed

    private void buttonAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAlterarActionPerformed
        controle.alterar();
    }//GEN-LAST:event_buttonAlterarActionPerformed

    private void buttonBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBuscarActionPerformed
        controle.buscar();
    }//GEN-LAST:event_buttonBuscarActionPerformed

    private void buttonLimparBuscaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLimparBuscaActionPerformed
        controle.limparBusca();
    }//GEN-LAST:event_buttonLimparBuscaActionPerformed

    private void buttonCroquiVisualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCroquiVisualizarActionPerformed
        controle.visualizarCroqui();
    }//GEN-LAST:event_buttonCroquiVisualizarActionPerformed

    private void buttonCroquiAnexarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCroquiAnexarActionPerformed
        controle.anexarCroqui();
    }//GEN-LAST:event_buttonCroquiAnexarActionPerformed

    private void buttonCroquiAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCroquiAlterarActionPerformed
        controle.alterarCroqui();
    }//GEN-LAST:event_buttonCroquiAlterarActionPerformed

    private void buttonCroquiRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCroquiRemoverActionPerformed
        controle.removerCroqui();
    }//GEN-LAST:event_buttonCroquiRemoverActionPerformed

    private void textBuscaNomeMunicipioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textBuscaNomeMunicipioActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_textBuscaNomeMunicipioActionPerformed

    private void textBuscaCodigoMunicipioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textBuscaCodigoMunicipioActionPerformed
        controle.eventoTextCodigoMunicipio(null, null, this.textBuscaCodigoMunicipio, this.textBuscaNomeMunicipio);
    }//GEN-LAST:event_textBuscaCodigoMunicipioActionPerformed

    private void textNomeMunicipioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textNomeMunicipioActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_textNomeMunicipioActionPerformed

    private void textCodigoMunicipioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textCodigoMunicipioActionPerformed
        controle.textCodigoMunicipio(textCodigoMunicipio, textNomeMunicipio);
    }//GEN-LAST:event_textCodigoMunicipioActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton buttonAlterar;
    public javax.swing.JButton buttonBuscar;
    public javax.swing.JButton buttonCadastro;
    public javax.swing.JButton buttonCancelar;
    public javax.swing.JButton buttonCroquiAlterar;
    public javax.swing.JButton buttonCroquiAnexar;
    public javax.swing.JButton buttonCroquiRemover;
    public javax.swing.JButton buttonCroquiVisualizar;
    public javax.swing.JButton buttonLimpar;
    public javax.swing.JButton buttonLimparBusca;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel labelAs;
    private javax.swing.JLabel labelBuscaCodigo;
    private javax.swing.JLabel labelBuscaMunicipio;
    private javax.swing.JLabel labelBuscaNome;
    private javax.swing.JLabel labelCodigo;
    private javax.swing.JLabel labelId;
    private javax.swing.JLabel labelMunicípio;
    private javax.swing.JLabel labelNome;
    private javax.swing.JLabel labelUltimaVersao;
    private javax.swing.JPanel panelBusca;
    private javax.swing.JPanel panelCroqui;
    private javax.swing.JPanel panelInformacoes;
    private javax.swing.JPanel panelLocalidades;
    private javax.swing.JPanel panelOpcoes;
    public javax.swing.JTable tabela;
    public javax.swing.JTextField textBuscaCodigo;
    public javax.swing.JTextField textBuscaCodigoMunicipio;
    public javax.swing.JTextField textBuscaNome;
    public javax.swing.JTextField textBuscaNomeMunicipio;
    public javax.swing.JTextField textCodigo;
    public javax.swing.JTextField textCodigoMunicipio;
    public javax.swing.JTextField textDataCroqui;
    public javax.swing.JTextField textHoraCroqui;
    public javax.swing.JTextField textId;
    public javax.swing.JTextField textNome;
    public javax.swing.JTextField textNomeMunicipio;
    // End of variables declaration//GEN-END:variables
}
